import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView
    },
    {
      path:'/login',
      name:'login',
      component:()=>import('../views/Login.vue')
    },
    {
      path:'/customer/orderList',
      name:'orderList',
      component:()=>import('../views/Customer/OrderList.vue')
    },
    {
      path:'/customer/payment',
      name:'payment',
      component:()=>import('../views/Customer/Payment.vue')
    },
    {
      path:'/customer/businessInfo',
      name:'businessInfo',
      component:()=>import('../views/Customer/BusinessInfo.vue')
    },
    {
      path:'/customer/businessList',
      name:'businessList',
      component:()=>import('../views/Customer/BusinessList.vue')
    },
    {
      path:'/customer/',
      name:'customer',
      component:()=>import('../views/Customer/Index.vue')
    },
    {
      path:'/customer/userInfo',
      name:'userInfo',
      component:()=>import('../views/Customer/UserInfo.vue')
    },
    {
      path: '/business',
      name: 'business',
      component: () => import('../views/BusinessIndex.vue' ),
      children:[
        {
          path:'',
          name:'indexInfo',
          component:()=>import('../views/BusinessManager/indexInfo.vue')
        },
        {
          path:'shopList',
          name:'shopList',
          component:()=>import('../views/BusinessManager/shopList.vue')

        },
        {
          path:'shopItemList',
          name:'shopItemList',
          component:()=>import('../views/BusinessManager/shopItemList.vue')

        },
        {
          path:'customerOrderList',
          name:'customerOrderList',
          component:()=>import('../views/BusinessManager/customerOrderList.vue')

        }
      ]
    }
  ]
})

export default router
